package com.twu.biblioteca;

import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * User: gpereir
 * Date: 5/29/13
 * Time: 2:00 PM
 * To change this template use File | Settings | File Templates.
 */
public class IOHandler implements IOInterface{
    private PrintStream output;
    private InputStream input;
    private Scanner scan;

    public IOHandler() {
        this.input = System.in;
        this.output = System.out;

    }

    public IOHandler(PrintStream printStream, InputStream inputStream) {
        this.input = inputStream;
        this.output = printStream;
    }

    @Override
    public void printMessage(String message) {
        output.print(message);
    }

    @Override
    public String getInput() {
        scan = new Scanner(this.input);
        return scan.nextLine();
    }

}
